Title Banner

Previous Book Contents Book Index Next

Inside Macintosh: OpenDoc Programmer's Guide / Part 2 - Programming
Chapter 10 - Extending OpenDoc


Custom Transform Objects

OpenDoc transform objects provide powerful transformational capabilities that are sufficient for most two-dimensional drawing. With transforms, you not only can position your graphical objects, but you also easily can scale, rotate, and skew them. You can combine the operations of frames' internal transforms with those of facets' external transforms to achieve sophisticated effects with a minimum of code.

If you need to extend the power of transform objects even further, you can obtain the extra capability most efficiently by creating your own transform subclass. If you need to provide for nonlinear transformations (such as curved projections or sophisticated perspective effects), you can implement them as new methods and as overrides to the methods of ODBaseTransform, the superclass of ODTransform.

If you subclass ODBaseTransform, you must override at least the following methods:
CopyInvertPointReset
CopyFromInvertShapeTransformPoint
GetMatrixPostComposeTransformShape
HasMatrixPreComposeWriteTo
InvertReadFrom 

Your GetMatrix method must throw the exception ODErrTransformErr. Your HasMatrix method must return kODFalse. Other methods should perform tasks appropriate to your transform.

For more information on matrices and transformations in two-dimensional drawing, you can consult any standard computer-graphics textbook, such as Computer Graphics Principles and Practice, 2nd ed., by Foley, vanDam, Feiner, and Hughes (Addison-Wesley, 1990).


Previous Book Contents Book Index Next

© Apple Computer, Inc.
16 JUL 1996




Navigation graphic, see text links

Main | Page One | What's New | Apple Computer, Inc. | Find It | Contact Us | Help